home *** CD-ROM | disk | FTP | other *** search
/ Sun Solutions 2000 #2 / Sun Solutions CD (Volume 2 2000)(Special Focus - Java Technologies)(Disc 1).ISO / products / Software / BostonBusinessComputing / bbc / vmail.setup < prev    next >
Text File  |  2000-02-11  |  1KB  |  57 lines

  1. :
  2. # Determine how to get group id
  3. lscmd=`(ls -ldg . ; ls -ld .) | awk 'NR==1{fields=NF} NR==2{if (fields > NF) { print "ls -ldg" } else { print "ls -ld" }}'`
  4.  
  5. tbput display "Checking for the location of the native mail spool directory..."
  6. mail_path=''
  7. for d in /usr/mail /usr/spool/mail /var/mail /var/spool/mail; do
  8.     [ -d $d/. ] || continue
  9.     mail_path=$d
  10.     break
  11. done
  12. tbput display 'done
  13. '
  14.  
  15. if [ -z "$mail_path" ]; then
  16. #
  17. # Incorrect mail path or no mail path detected.
  18. # Ask for mail spool directory.
  19. #
  20.     while :; do                 #1 Keep asking for dir until got a good one
  21.     tbput display "
  22. Please enter the full path of the mail spool directory: "
  23.         read mail_path || exit 1
  24. #
  25. # Keep looping if blank
  26. #
  27.         [ -z "$mail_path" ] && continue
  28. #
  29. # Check that this directory exists
  30. #
  31.         [ -d "$mail_path/." ] && break
  32. #
  33. # It doesn't exist.  Ask if this is ok.
  34. #
  35.         tbput display "The \b$mail_path\B directory cannot be detected."
  36.     done
  37. fi
  38.  
  39. #
  40. # Get Group ID
  41. #
  42. set -$- `eval $lscmd $mail_path/.`
  43. group_priv=$4
  44.  
  45. #
  46. # Set Protections for Vmail
  47. #
  48. chgrp $group_priv $BBC/vmail.x
  49. chmod 755 $BBC/vmail.x
  50. chmod g+s $BBC/vmail.x
  51. chmod g+w $mail_path
  52.  
  53. tbput display "Your mail spool directory is \b$mail_path\B.
  54. The protections and group ownership for Vmail have been changed
  55. to correspond with those of that directory.
  56. "
  57.